@using Emoney.UserTraining.Model;
@{
    Layout = null;
    List<Power> lst = (List<Power>)ViewData["menu"];
    var bootLst = lst.Where(x => string.IsNullOrEmpty(x.Pid));
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link href="@Url.Content("~/css/admin.css")" type="text/css" rel="stylesheet">
    <script language="javascript" type="text/javascript">
        function expand(el) {
            childObj = document.getElementById("child" + el);

            if (childObj.style.display == 'none') {
                childObj.style.display = 'block';
            }
            else {
                childObj.style.display = 'none';
            }
            return;
        }
    </script>
</head>
<body>
    <table height="100%" cellspacing="0" cellpadding="0" width="170" background="@Url.Content("~/images/menu_bg.jpg")" border="0">
        @for (int i = 0; i < bootLst.Count(); i++)
        {
            var c = bootLst.ElementAt(i);
            <tr>
                <td valign="top" align="middle">
                    <table cellspacing="0" cellpadding="0" width="100%" border="0">
                        <tr>
                            <td height="10"></td>
                        </tr>
                    </table>
                    <table cellspacing="0" cellpadding="0" width="150" border="0">
                        <tr height="22">
                            <td style="padding-left: 30px" background="@Url.Content("~/images/menu_bt.jpg")"><a class="menuParent" onclick="expand(@i)" href="javascript:void(0);">@c.Name</a></td>
                        </tr>
                        <tr height="4">
                            <td></td>
                        </tr>
                    </table>
                    <table id="child@(i)" style="display: none" cellspacing="0" cellpadding="0" width="150" border="0">
                        @{var tempLst = lst.Where(x => x.Pid == c.Id);}
                        @foreach (var t in tempLst)
                        {
                            <tr height="20">
                                <td align="middle" width="30">
                                    <img height="9" src="@Url.Content("~/images/menu_icon.gif")" width="9"></td>
                                <td><a class="menuChild"  href="@Url.Content("~/" + t.Url)"  target="main">@t.Name</a></td>
                            </tr>
                        }
                    </table>
                </td>
            </tr>
        }
    </table>
</body>
</html>
